import * as $stts from '../services/stts'
import dayjs from 'dayjs'
module.exports = {
  title: '日常统计',
  role: '1,7,9,11,13,15,17,19,21,23 * * *',
  enable: true,
  async run () {
    let h = parseInt(dayjs().format('hh'))
    if (h < 7) {
      let yd = dayjs().subtract(1, 'day').format('YYYY-MM-DD')
      await $stts.daily(yd)
      return
    }
    let td = dayjs().format('YYYY-MM-DD')
    await $stts.daily(td)
  }
}
